file(GLOB PROTO_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/*.proto)
execute_process(COMMAND ${PROTOBUF_PROTOC} 
  -I${CMAKE_CURRENT_SOURCE_DIR} 
  --cpp_out=${CMAKE_CURRENT_SOURCE_DIR} 
  ${PROTO_SOURCE}
)

file(GLOB RPC_SOURCE 
  "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp" 
  "${CMAKE_CURRENT_SOURCE_DIR}/*.cc"
)
add_library(rpc ${RPC_SOURCE})
target_link_libraries(rpc 
  PRIVATE net
  PRIVATE ${PROTOBUF_LIB}
)